home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 5
/
Aminet 5 - March 1995.iso
/
Aminet
/
dev
/
gcc
/
gcc263_doc.lha
/
gnu
/
man
/
man1
/
cccp.1
< prev
next >
Wrap
Text File
|
1994-12-19
|
23KB
|
463 lines
cpp(1) GNU Tools cpp(1)
NNNNAAAAMMMMEEEE
cccp, cpp - The GNU C-Compatible Compiler Preprocessor.
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
ccccccccccccpppp [----$$$$] [----AAAA_p_r_e_d_i_c_a_t_e[((((_v_a_l_u_e))))]] [----CCCC] [----DDDD_n_a_m_e[====_d_e_f_i_n_i_t_i_o_n]]
[----ddddDDDD] [----ddddMMMM] [----IIII _d_i_r_e_c_t_o_r_y] [----HHHH] [----IIII----] [----iiiimmmmaaaaccccrrrroooossss _f_i_l_e] [
----iiiinnnncccclllluuuuddddeeee _f_i_l_e] [----iiiiddddiiiirrrraaaafffftttteeeerrrr _d_i_r] [----iiiipppprrrreeeeffffiiiixxxx _p_r_e_f_i_x] [----
iiiiwwwwiiiitttthhhhpppprrrreeeeffffiiiixxxx _d_i_r] [----llllaaaannnngggg----cccc] [----llllaaaannnngggg----cccc++++++++] [----llllaaaannnngggg----oooobbbbjjjjcccc] [----
llllaaaannnngggg----oooobbbbjjjjcccc++++++++] [----lllliiiinnnntttt] [----MMMM [----MMMMGGGG]] [----MMMMMMMM [----MMMMGGGG]] [----MMMMDDDD _f_i_l_e ]
[----MMMMMMMMDDDD _f_i_l_e ] [----nnnnoooossssttttddddiiiinnnncccc] [----nnnnoooossssttttddddiiiinnnncccc++++++++] [----PPPP] [----ppppeeeeddddaaaannnnttttiiiicccc]
[----ppppeeeeddddaaaannnnttttiiiicccc----eeeerrrrrrrroooorrrrssss] [----ttttrrrraaaaddddiiiittttiiiioooonnnnaaaallll] [----ttttrrrriiiiggggrrrraaaapppphhhhssss] [----UUUU_n_a_m_e]
[----uuuunnnnddddeeeeffff] [----WWWWttttrrrriiiiggggrrrraaaapppphhhhssss] [----WWWWccccoooommmmmmmmeeeennnntttt] [----WWWWaaaallllllll] [----
WWWWttttrrrraaaaddddiiiittttiiiioooonnnnaaaallll]
[_i_n_f_i_l_e|----] [_o_u_t_f_i_l_e|----]
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
The C preprocessor is a _m_a_c_r_o _p_r_o_c_e_s_s_o_r that is used au-
tomatically by the C compiler to transform your program be-
fore actual compilation. It is called a macro processor be-
cause it allows you to define _m_a_c_r_o_s, which are brief abbre-
viations for longer constructs.
The C preprocessor provides four separate facilities that
you can use as you see fit:
+o Inclusion of header files. These are files of de-
clarations that can be substituted into your program.
+o Macro expansion. You can define _m_a_c_r_o_s, which are ab-
breviations for arbitrary fragments of C code, and then
the C preprocessor will replace the macros with their
definitions throughout the program.
+o Conditional compilation. Using special preprocessor
commands, you can include or exclude parts of the pro-
gram according to various conditions.
+o Line control. If you use a program to combine or
rearrange source files into an intermediate file which
is then compiled, you can use line control to inform
the compiler of where each source line originally came
from.
C preprocessors vary in some details. For a full explana-
tion of the GNU C preprocessor, see the iiiinnnnffffoooo file
`ccccpppppppp....iiiinnnnffffoooo', or the manual _T_h_e _C _P_r_e_p_r_o_c_e_s_s_o_r. Both of these
are built from the same documentation source file,
`ccccpppppppp....tttteeeexxxxiiiinnnnffffoooo'. The GNU C preprocessor provides a superset
of the features of ANSI Standard C.
ANSI Standard C requires the rejection of many harmless con-
structs commonly used by today's C programs. Such incompa-
GNU Tools Last change: 30apr1993 1
cpp(1) GNU Tools cpp(1)
tibility would be inconvenient for users, so the GNU C
preprocessor is configured to accept these constructs by de-
fault. Strictly speaking, to get ANSI Standard C, you must
use the options `----ttttrrrriiiiggggrrrraaaapppphhhhssss', `----uuuunnnnddddeeeeffff' and `----ppppeeeeddddaaaannnnttttiiiicccc', but
in practice the consequences of having strict ANSI Standard
C make it undesirable to do this.
Most often when you use the C preprocessor you will not have
to invoke it explicitly: the C compiler will do so automati-
cally. However, the preprocessor is sometimes useful indi-
vidually.
When you call the preprocessor individually, either name
(ccccpppppppp or ccccccccccccpppp) will do-they are completely synonymous.
The C preprocessor expects two file names as arguments, _i_n_-
_f_i_l_e and _o_u_t_f_i_l_e. The preprocessor reads _i_n_f_i_l_e together
with any other files it specifies with `####iiiinnnncccclllluuuuddddeeee'. All the
output generated by the combined input files is written in
_o_u_t_f_i_l_e.
Either _i_n_f_i_l_e or _o_u_t_f_i_l_e may be `---- ', which as _i_n_f_i_l_e means
to read from standard input and as _o_u_t_f_i_l_e means to write to
standard output. Also, if _o_u_t_f_i_l_e or both file names are
omitted, the standard output and standard input are used for
the omitted file names.
OOOOPPPPTTTTIIIIOOOONNNNSSSS
Here is a table of command options accepted by the C prepro-
cessor. These options can also be given when compiling a C
program; they are passed along automatically to the prepro-
cessor when it is invoked by the compiler.
----PPPP Inhibit generation of `####'-lines with line-number in-
formation in the output from the preprocessor. This
might be useful when running the preprocessor on some-
thing that is not C code and will be sent to a program
which might be confused by the `####'-lines.
----CCCC Do not discard comments: pass them through to the out-
put file. Comments appearing in arguments of a macro
call will be copied to the output before the expansion
of the macro call.
----ttttrrrraaaaddddiiiittttiiiioooonnnnaaaallll
Try to imitate the behavior of old-fashioned C, as op-
posed to ANSI C.
----ttttrrrriiiiggggrrrraaaapppphhhhssss
Process ANSI standard trigraph sequences. These are
three-character sequences, all starting with `????????', that
are defined by ANSI C to stand for single characters.
GNU Tools Last change: 30apr1993 2
cpp(1) GNU Tools cpp(1)
For example, `????????////' stands for `\\\\', so `''''????????////nnnn''''' is a
character constant for a newline. Strictly speaking,
the GNU C preprocessor does not support all programs in
ANSI Standard C unless `----ttttrrrriiiiggggrrrraaaapppphhhhssss' is used, but if you
ever notice the difference it will be with relief.
You don't want to know any more about trigraphs.
----ppppeeeeddddaaaannnnttttiiiicccc
Issue warnings required by the ANSI C standard in cer-
tain cases such as when text other than a comment fol-
lows `####eeeellllsssseeee' or `####eeeennnnddddiiiiffff'.
----ppppeeeeddddaaaannnnttttiiiicccc----eeeerrrrrrrroooorrrrssss
Like `----ppppeeeeddddaaaannnnttttiiiicccc', except that errors are produced rath-
er than warnings.
----WWWWttttrrrriiiiggggrrrraaaapppphhhhssss
Warn if any trigraphs are encountered (assuming they
are enabled).
----WWWWccccoooommmmmmmmeeeennnntttt
----WWWWccccoooommmmmmmmeeeennnnttttssss
Warn whenever a comment-start sequence `////****' appears in
a comment. (Both forms have the same effect).
----WWWWaaaallllllll
Requests both `----WWWWttttrrrriiiiggggrrrraaaapppphhhhssss' and `----WWWWccccoooommmmmmmmeeeennnntttt' (but not `----
WWWWttttrrrraaaaddddiiiittttiiiioooonnnnaaaallll').
----WWWWttttrrrraaaaddddiiiittttiiiioooonnnnaaaallll
Warn about certain constructs that behave differently
in traditional and ANSI C.
----IIII _d_i_r_e_c_t_o_r_y
Add the directory _d_i_r_e_c_t_o_r_y to the end of the list of
directories to be searched for header files. This can
be used to override a system header file, substituting
your own version, since these directories are searched
before the system header file directories. If you use
more than one `----IIII' option, the directories are scanned
in left-to-right order; the standard system directories
come after.
----IIII---- Any directories specified with `---- IIII' options before
the ` ---- IIII ---- ' option are searched only for the case of
`####iiiinnnncccclllluuuuddddeeee _f_i_l_e"'; they are not searched for `####iiiinnnncccclllluuuuddddeeee
<<<<_f_i_l_e>'.
If additional directories are specified with `---- IIII' op-
tions after the `----IIII---- ', these directories are searched
GNU Tools Last change: 30apr1993 3
cpp(1) GNU Tools cpp(1)
for all `####iiiinnnncccclllluuuuddddeeee' directives.
In addition, the `----IIII---- ' option inhibits the use of the
current directory as the first search directory for
`####iiiinnnncccclllluuuuddddeeee _f_i_l_e"'. Therefore, the current directory is
searched only if it is requested explicitly with `----IIII....'.
Specifying both `----IIII---- ' and `----IIII....' allows you to control
precisely which directories are searched before the
current one and which are searched after.
----nnnnoooossssttttddddiiiinnnncccc
Do not search the standard system directories for
header files. Only the directories you have specified
with `----IIII' options (and the current directory, if ap-
propriate) are searched.
----nnnnoooossssttttddddiiiinnnncccc++++++++
Do not search for header files in the C++ specific
standard directories, but do still search the other
standard directories. (This option is used when build-
ing libg++.)
----DDDD _n_a_m_e
Predefine _n_a_m_e as a macro, with definition `1111'.
----DDDD _n_a_m_e====_d_e_f_i_n_i_t_i_o_n
Predefine _n_a_m_e as a macro, with definition _d_e_f_i_n_i_t_i_o_n.
There are no restrictions on the contents of _d_e_f_i_n_i_-
_t_i_o_n, but if you are invoking the preprocessor from a
shell or shell-like program you may need to use the
shell's quoting syntax to protect characters such as
spaces that have a meaning in the shell syntax. If you
use more than one `----DDDD' for the same _n_a_m_e, the rightmost
definition takes effect.
----UUUU _n_a_m_e
Do not predefine _n_a_m_e. If both `----UUUU' and ` ---- DDDD' are
specified for one name, the `----UUUU' beats the `----DDDD' and the
name is not predefined.
----uuuunnnnddddeeeeffff
Do not predefine any nonstandard macros.
----AAAA _n_a_m_e(vvvvaaaalllluuuueeee)
Assert (in the same way as the ####aaaasssssssseeeerrrrtttt command) the
predicate _n_a_m_e with tokenlist _v_a_l_u_e. Remember to es-
cape or quote the parentheses on shell command lines.
You can use `----AAAA----' to disable all predefined assertions;
it also undefines all predefined macros.
----ddddMMMM Instead of outputting the result of preprocessing,
GNU Tools Last change: 30apr1993 4
cpp(1) GNU Tools cpp(1)
output a list of `####ddddeeeeffffiiiinnnneeee' commands for all the macros
defined during the execution of the preprocessor, in-
cluding predefined macros. This gives you a way of
finding out what is predefined in your version of the
preprocessor; assuming you have no file `ffffoooooooo....hhhh', the
command
touch foo.h; cpp -dM foo.h
will show the values of any predefined macros.
----ddddDDDD Like `----ddddMMMM' except in two respects: it does _n_o_t include
the predefined macros, and it outputs _b_o_t_h the `####ddddeeee----
ffffiiiinnnneeee' commands and the result of preprocessing. Both
kinds of output go to the standard output file.
----MMMM [----MMMMGGGG]
Instead of outputting the result of preprocessing, out-
put a rule suitable for mmmmaaaakkkkeeee describing the dependen-
cies of the main source file. The preprocessor outputs
one mmmmaaaakkkkeeee rule containing the object file name for that
source file, a colon, and the names of all the included
files. If there are many included files then the rule
is split into several lines using `\\\\'-newline.
`----MMMMGGGG' says to treat missing header files as generated
files and assume they live in the same directory as the
source file. It must be specified in addition to `----MMMM'.
This feature is used in automatic updating of
makefiles.
----MMMMMMMM [----MMMMGGGG]
Like `----MMMM' but mention only the files included with
`####iiiinnnncccclllluuuuddddeeee "_f_i_l_e"'. System header files included with
`####iiiinnnncccclllluuuuddddeeee <_f_i_l_e>' are omitted.
----MMMMDDDD _f_i_l_e
Like `----MMMM' but the dependency information is written to
`_f_i_l_e'. This is in addition to compiling the file as
specified-`----MMMMDDDD' does not inhibit ordinary compilation
the way `----MMMM' does.
When invoking gcc, do not specify the `_f_i_l_e' argument.
Gcc will create file names made by replacing `....cccc' with
`....dddd' at the end of the input file names.
In Mach, you can use the utility mmmmdddd to merge multiple
files into a single dependency file suitable for using
with the `mmmmaaaakkkkeeee' command.
----MMMMMMMMDDDD _f_i_l_e
GNU Tools Last change: 30apr1993 5
cpp(1) GNU Tools cpp(1)
Like `----MMMMDDDD' except mention only user header files, not
system header files.
----HHHH Print the name of each header file used, in addition
to other normal activities.
----iiiimmmmaaaaccccrrrroooossss _f_i_l_e
Process _f_i_l_e as input, discarding the resulting out-
put, before processing the regular input file. Because
the output generated from _f_i_l_e is discarded, the only
effect of `----iiiimmmmaaaaccccrrrroooossss _f_i_l_e' is to make the macros defined
in _f_i_l_e available for use in the main input. The
preprocessor evaluates any `----DDDD' and `----UUUU' options on the
command line before processing `----iiiimmmmaaaaccccrrrroooossss _f_i_l_e' .
----iiiinnnncccclllluuuuddddeeee _f_i_l_e
Process _f_i_l_e as input, and include all the resulting
output, before processing the regular input file.
----iiiiddddiiiirrrraaaafffftttteeeerrrr _d_i_r
Add the directory _d_i_r to the second include path. The
directories on the second include path are searched
when a header file is not found in any of the direc-
tories in the main include path (the one that `----IIII' adds
to).
----iiiipppprrrreeeeffffiiiixxxx _p_r_e_f_i_x
Specify _p_r_e_f_i_x as the prefix for subsequent ` ---- iiiiwwwwiiiitttthhhh----
pppprrrreeeeffffiiiixxxx' options.
----iiiiwwwwiiiitttthhhhpppprrrreeeeffffiiiixxxx _d_i_r
Add a directory to the second include path. The
directory's name is made by concatenating _p_r_e_f_i_x and
_d_i_r, where _p_r_e_f_i_x was specified previously with `----iiiipppprrrreeee----
ffffiiiixxxx'.
----llllaaaannnngggg----cccc
----llllaaaannnngggg----cccc++++++++
----llllaaaannnngggg----oooobbbbjjjjcccc
----llllaaaannnngggg----oooobbbbjjjjcccc++++++++
Specify the source language. ` ---- llllaaaannnngggg----cccc++++++++' makes the
preprocessor handle C++ comment syntax, and includes
extra default include directories for C++, and `---- llllaaaannnngggg----
oooobbbbjjjjcccc' enables the Objective C `####iiiimmmmppppoooorrrrtttt' directive. `----
llllaaaannnngggg----cccc' explicitly turns off both of these extensions,
and `----llllaaaannnngggg----oooobbbbjjjjcccc++++++++' enables both.
These options are generated by the compiler driver ggggcccccccc,
but not passed from the `ggggcccccccc' command line.
GNU Tools Last change: 30apr1993 6
cpp(1) GNU Tools cpp(1)
----lllliiiinnnntttt
Look for commands to the program checker lllliiiinnnntttt embedded
in comments, and emit them preceded by `####pppprrrraaaaggggmmmmaaaa lllliiiinnnntttt'.
For example, the comment `////**** NNNNOOOOTTTTRRRREEEEAAAACCCCHHHHEEEEDDDD ****////' becomes
`####pppprrrraaaaggggmmmmaaaa lllliiiinnnntttt NOTREACHED'.
This option is available only when you call ccccpppppppp direct-
ly; ggggcccccccc will not pass it from its command line.
----$$$$ Forbid the use of `$$$$' in identifiers. This is re-
quired for ANSI conformance. ggggcccccccc automatically sup-
plies this option to the preprocessor if you specify `----
aaaannnnssssiiii', but ggggcccccccc doesn't recognize the `----$$$$' option itself
-to use it without the other effects of ` ---- aaaannnnssssiiii', you
must call the preprocessor directly.
SSSSEEEEEEEE AAAALLLLSSSSOOOO
`CCCCpppppppp' entry in iiiinnnnffffoooo; _T_h_e _C _P_r_e_p_r_o_c_e_s_s_o_r, Richard M. Stall-
man.
ggggcccccccc(1111); `GGGGcccccccc' entry in iiiinnnnffffoooo; _U_s_i_n_g _a_n_d _P_o_r_t_i_n_g _G_N_U _C_C (_f_o_r
_v_e_r_s_i_o_n _2._0), Richard M. Stallman.
CCCCOOOOPPPPYYYYIIIINNNNGGGG
Copyright (c) 1991, 1992, 1993 Free Software Foundation,
Inc.
Permission is granted to make and distribute verbatim copies
of this manual provided the copyright notice and this per-
mission notice are preserved on all copies.
Permission is granted to copy and distribute modified ver-
sions of this manual under the conditions for verbatim copy-
ing, provided that the entire resulting derived work is dis-
tributed under the terms of a permission notice identical to
this one.
Permission is granted to copy and distribute translations of
this manual into another language, under the above condi-
tions for modified versions, except that this permission no-
tice may be included in translations approved by the Free
Software Foundation instead of in the original English.
GNU Tools Last change: 30apr1993 7